package cn.rainbow.modules.sys.entity;

import cn.rainbow.common.validator.group.AddGroup;
import cn.rainbow.common.validator.group.UpdateGroup;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created on 2019/1/5.
 *
 * @author sehuaqi.
 * 描述：
 */
@TableName("sys_addr")
public class SysAddrEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId
    private Long id;

    /**
     * 用户名
     */
    private long userId;

    /**
     * 收件人姓名
     */
    @NotBlank(message="收件人姓名", groups = {AddGroup.class, UpdateGroup.class})
    private String recipients;

    /**
     * 手机号码
     */
    @NotBlank(message="手机号码", groups = {AddGroup.class, UpdateGroup.class})
    private String mobile;

    /**
     * 省市区县
     */
    @NotBlank(message="省市区县", groups = {AddGroup.class, UpdateGroup.class})
    private String addr;

    /**
     * 收件人姓名
     */
    @NotBlank(message="详细地址", groups = {AddGroup.class, UpdateGroup.class})
    private String detail;

    /**
     * 坐标
     */
    private String position;

    /**
     * 是否默认，0否，1是
     */
    @NotNull(message="是否默认", groups = {AddGroup.class, UpdateGroup.class})
    private int def;


    /**
     * 标签
     */
    @TableField(exist=false)
    private List<String> flagList;

    /**
     * 标签 10：家，20：公司，30：学校
     */
    private String flag;


    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 修改时间
     */
    private Date updateDate;

    /**
     * 删除标识 0未删除 1已删除
     */
    private int isDeleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getRecipients() {
        return recipients;
    }

    public void setRecipients(String recipients) {
        this.recipients = recipients;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public int getDef() {
        return def;
    }

    public void setDef(int def) {
        this.def = def;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public int getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(int isDeleted) {
        this.isDeleted = isDeleted;
    }

    public List<String> getFlagList() {
        return flagList;
    }

    public void setFlagList(List<String> flagList) {
        this.flagList = flagList;
    }
}
